import { ajaxGet, ajaxPost } from '../utils/ajax'
import { GET_USER_INFO_URL, LOGIN_URL, REGISTER_URL } from '../conf/apis'

async function registerService(userInfo = {}) {
  return await ajaxPost(REGISTER_URL, userInfo)
}

async function loginService(username, password) {
  return await ajaxPost(LOGIN_URL, { username, password })
}

async function getUserInfoService() {
  return await ajaxGet(GET_USER_INFO_URL)
}

export { registerService, loginService, getUserInfoService }
